package com.xuecheng.media.domain.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xuecheng.media.domain.model.entity.MediaProcess;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author itcast
 */
public interface MediaProcessMapper extends BaseMapper<MediaProcess> {

    List<MediaProcess> getWaitHandleTaskList(@Param("index") Integer shardIndex,
                                             @Param("total") Integer shardTotal,
                                             @Param("count") Integer processors);

    int startTask(@Param("taskId") Long taskId,
                  @Param("now") LocalDateTime now);

    List<MediaProcess> getCompensateTaskList(@Param("index") Integer shardIndex,
                                             @Param("total") Integer shardTotal,
                                             @Param("count") Integer processors);
}
